package com.xiaotu.model;

import org.apache.commons.lang.StringUtils;

/**
 * 公共参数类
 * @作者 王艳龙
 * @日期 2021-01-20 10:12
 * @功能
 */
public class ParamModel {

    //艺人id
    private String starId;
    //作品id
    private String tvId;
    //开始时间
    private String startDate;
    //结束时间
    private String endDate;
    //当前页 默认第一页
    private Integer page;
    //每页页数 默认显示100
    private Integer rows;
    //用户名
    String userName;
    //用户密码
    String passWord;
    //动态获取的表名
    private String tableName;
    //类型
    private String type;

    public String getStarId() {
        return starId;
    }

    public void setStarId(String starId) {
        starId = getAppendStr(starId);
        this.starId = starId;
    }

    public String getTvId() {
        return tvId;
    }

    public void setTvId(String tvId) {
        tvId = getAppendStr(tvId);
        this.tvId = tvId;
    }

    public String getStartDate() {
        return startDate;
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    public String getEndDate() {
        return endDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getRows() {
        return rows;
    }

    public void setRows(Integer rows) {
        this.rows = rows;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getAppendStr(String str){
        String resultStr = "";
        if(StringUtils.isNotEmpty(str)){
            String[] starIdArr =str.split(",");
            for (String starIds : starIdArr) {
                if(StringUtils.isNotEmpty(starIds)){
                    resultStr += "'"+starIds.toString()+"',";
                }
            }
            if(resultStr.length()>0){
                resultStr =resultStr.substring(0,resultStr.length()-1);
            }
        }
        System.out.println("resultSt================"+resultStr);
            return resultStr;
    }
}
